﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using ChessSuite.Utilities.Common.Enumeations;

namespace ChessSuite.Utilities.Common.Utilities
{
    public static partial class PieceTypeUtility
    {
        public static IEnumerable<PieceType> Compress(this IEnumerable<PieceType> piece)
        {
            return FromIndividualCounts(piece.Count(PieceType.Pawn),
                piece.Count(PieceType.Bishop),
                piece.Count(PieceType.Knight),
                piece.Count(PieceType.Rook),
                piece.Count(PieceType.Queen),
                piece.Count(PieceType.King));
        }
    }
}
